<!DOCTYPE html>
<html>
	<head>
		<title>Histórico de partidos | Club Atlético Independiente</title>
		<link href="<?php echo $view['assets']->getUrl('css/bootstrap.css') ?>" rel="stylesheet">
		<link href="<?php echo $view['assets']->getUrl('font-awesome/css/font-awesome.css') ?>" rel="stylesheet">
		<!-- DateTime picker bootstrap -->
		<link href="<?php echo $view['assets']->getUrl('css/datepicker3.css') ?>" rel="stylesheet">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<script src="<?php echo $view['assets']->getUrl('js/jquery-1.11.1.min.js') ?>"></script>
		<script src="<?php echo $view['assets']->getUrl('js/bootstrap.js') ?>"></script>
		<script src="<?php echo $view['assets']->getUrl('js/jquery.numeric.js') ?>"></script>
		<script src="<?php echo $view['assets']->getUrl('bundles/fosjsrouting/js/router.js') ?>"></script>
		<script src="<?php echo $view['router']->generate('fos_js_routing_js', array('callback' => 'fos.Router.setData')) ?>"></script>
		<!-- DateTime Picker Bootstrap-->
		<script src="<?php echo $view['assets']->getUrl('js/bootstrap-datepicker.js') ?>"></script>

		<script src="<?php echo $view['assets']->getUrl('js/forms_requests.js') ?>"></script>
	</head>
	<body>
		<nav class="navbar navbar-default navbar-static-top" role="navigation">
			<div class="container-fluid">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
				        <span class="sr-only">Toggle navigation</span>
				        <span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
			    	</button>
			    	<a class="navbar-brand" href="#">Histórico Partidos CAI</a>
				</div>
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li class="active"><a href="">Partidos</a></li>
						<li><a href="<?php echo $view['router']->generate('torneos') ?>">Torneos</a></li>
						<li><a href="<?php echo $view['router']->generate('equipos') ?>">Equipos</a></li>
						<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" href="#">Personas <span class="caret"></span></a>
							<ul class="dropdown-menu" role="menu">
								<li><a href="<?php echo $view['router']->generate('arbitros') ?>">Arbitros</a> </li>
								<li><a href="<?php echo $view['router']->generate('tecnicos') ?>">Tecnicos</a> </li>
								<li><a href="">Jugadores</a> </li>
							</ul>
						</li>
						<li><a href="<?php echo $view['router']->generate('busquedas') ?>">Búsquedas</a></li>
					</ul>
					<button data-toggle="modal" data-target="#partidoNuevoModal" type="button" id="btnAgregarPartido" class="btn btn-danger navbar-btn navbar-right"><i class="fa fa-plus-square-o fa-fw"></i> <i class="fa fa-futbol-o"></i> Agregar partido nuevo</button>
				</div>
			</div>
		</nav>
		<div id="partidoNuevoModal" class="modal fade">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title"><span class="glyphicon glyphicon-pencil"></span> Complete el formulario para ingresar un nuevo partido</h4>
					</div>
					<div class="modal-body">
						<?php echo $view['form']->start($form, array('attr' => array('id' => 'formPartido',
							'class' => 'form-horizontal',
							'role' => 'form')));?>
						<div class="form-group row">
							<div class="col-md-4">
								<label class="control-label">Fecha</label>
								<div id="fechaPicker">
									<input type='text' class="form-control" id="partidoDia" name="partidoDia"/>
								</div>
							</div>
							<div class="col-md-4">
								<label for="selRival" class="control-label">Rival</label>
								<?php echo $view['form']->row($form['equipo'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
							<div class="col-md-4">
								<label for="selTorneoInst" class="control-label">Torneo</label>
								<?php echo $view['form']->row($form['torneoInstancia'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
						</div>
						<div class="form-group row">
							<div class="col-md-4">
								<label for="inputInstancia" class="control-label">Instancia</label>
								<?php echo $view['form']->row($form['partidosInstancia'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
							<div class="col-md-4">
								<label for="inputGolesCAI" class="control-label">Goles a favor</label>
								<?php echo $view['form']->row($form['partidosGolesCai'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
							<div class="col-md-4">
								<label for="inputGolesRival" class="control-label">Goles en contra</label>
								<?php echo $view['form']->row($form['partidosGolesRival'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
						</div>
						<div class="form-group row">
							<div class="col-md-4">
								<label for="inputPassword3" class="control-label">Condición</label>
								<?php echo $view['form']->row($form['partidosCondicion'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
							<div class="col-md-4">
								<label for="selDT" class="control-label">Director Técnico</label>
								<?php echo $view['form']->row($form['persona'], array('attr' => array('class' => 'form-control'), 'label' => false, 'read_only' => true));?>
							</div>
							<div class="col-md-4">
								<label for="selDT" class="control-label">Árbitro</label>
								<?php echo $view['form']->row($form['arbitro'], array('attr' => array('class' => 'form-control'), 'label' => false));?>
							</div>
						</div>
						<?php echo $view['form']->end($form) ?>
					</div>
					<div class="modal-footer">
						<div id="msgGuardarPartidoOK">
							<div class="col-md-6">
								<p class="text-success text-left"><span class="glyphicon glyphicon-ok"></span> Partido guardado!</p>
							</div>
						</div>
						<div id="msgGuardarPartidoError">
							<div class="col-md-6">
								<p class="text-danger text-left"><span class="glyphicon glyphicon-remove"></span> Error al guardar el partido</p>
							</div>
						</div>
						<button id="btnReset" class="btn btn-primary" type="button" >Limpiar formulario</button>
						<button id="btnGuardarPartido" class="btn btn-success" type="button" data-loading-text="Guardando..." autocomplete="off">Guardar partido</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->